<template>
  <cl-tooltip :content="props.tooltip" :disabled="!props.tooltip">
    <el-button v-bind="$attrs" :size="props.size">
      <template #icon v-if="props.icon">
        <cl-icon :icon="props.icon"></cl-icon>
      </template>
      <slot></slot>
    </el-button>
  </cl-tooltip>
</template>
<script lang="ts" setup>
// 禁用透传继承
defineOptions({
  inheritAttrs: false,
});

interface Props {
  icon?: string;
  tooltip?: string;
  size?: "large" | "default" | "small";
}

const props = withDefaults(defineProps<Props>(), {
  tooltip: "",
  size: "small",
  loading: false,
});
</script>
<style lang="scss" scoped></style>
